package com.edu.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.util.Date;
import lombok.Data;

/**
 * 教室申请分配表
 * @TableName application_allocation
 */
@TableName(value ="application_allocation")
@Data
public class ApplicationAllocation {
    /**
     * 分配ID
     */
    @TableId(type = IdType.AUTO)
    private Long allocationId;

    /**
     * 申请ID
     */
    private Long applicationId;

    /**
     * 教室ID
     */
    private Long classroomId;

    /**
     * 分配状态
     */
    private Object status;

    /**
     * 分配时间
     */
    private Date allocateTime;

    /**
     * 分配人ID
     */
    private Long allocatorId;

    /**
     * 分配备注
     */
    private String remark;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        ApplicationAllocation other = (ApplicationAllocation) that;
        return (this.getAllocationId() == null ? other.getAllocationId() == null : this.getAllocationId().equals(other.getAllocationId()))
            && (this.getApplicationId() == null ? other.getApplicationId() == null : this.getApplicationId().equals(other.getApplicationId()))
            && (this.getClassroomId() == null ? other.getClassroomId() == null : this.getClassroomId().equals(other.getClassroomId()))
            && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
            && (this.getAllocateTime() == null ? other.getAllocateTime() == null : this.getAllocateTime().equals(other.getAllocateTime()))
            && (this.getAllocatorId() == null ? other.getAllocatorId() == null : this.getAllocatorId().equals(other.getAllocatorId()))
            && (this.getRemark() == null ? other.getRemark() == null : this.getRemark().equals(other.getRemark()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getAllocationId() == null) ? 0 : getAllocationId().hashCode());
        result = prime * result + ((getApplicationId() == null) ? 0 : getApplicationId().hashCode());
        result = prime * result + ((getClassroomId() == null) ? 0 : getClassroomId().hashCode());
        result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
        result = prime * result + ((getAllocateTime() == null) ? 0 : getAllocateTime().hashCode());
        result = prime * result + ((getAllocatorId() == null) ? 0 : getAllocatorId().hashCode());
        result = prime * result + ((getRemark() == null) ? 0 : getRemark().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", allocationId=").append(allocationId);
        sb.append(", applicationId=").append(applicationId);
        sb.append(", classroomId=").append(classroomId);
        sb.append(", status=").append(status);
        sb.append(", allocateTime=").append(allocateTime);
        sb.append(", allocatorId=").append(allocatorId);
        sb.append(", remark=").append(remark);
        sb.append("]");
        return sb.toString();
    }
}